<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
</style>
<div class="bg-light lter b-b wrapper-md ng-scope">
    <h1 class="m-n font-thin h3">
        修改属性
        <div class="pull-right">
            <a href="#/app/attr" class="btn btn-sm btn-default">返回列表</a>
        </div>
    </h1>
</div>

<div class="wrapper-md ng-scope">
    <div class="panel panel-default">
        <div class="panel-heading">
            修改属性
        </div>
        <div class="form-horizontal ng-pristine ng-valid">
            <div class="form-group" style="padding-top: 20px;">
                <label class="col-sm-2 control-label">名字:</label>
                <div class="col-sm-4">
                    <input class="form-control  ng-pristine ng-untouched ng-valid"
                           ng-model="ctrl.vm.name" placeholder="请输入名字">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">别名:</label>
                <div class="col-sm-4">
                    <input class="form-control  ng-pristine ng-untouched ng-valid"
                           ng-model="ctrl.vm.alias" placeholder="请输入别名" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">后端是否显示:</label>
                <div class="col-sm-4">
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox" ng-model="ctrl.vm.backend_show">
                        <i></i>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">筛选项是否显示:</label>
                <div class="col-sm-4">
                    <label class="i-switch m-t-xs m-r">
                        <input type="checkbox" ng-model="ctrl.vm.fliter_show">
                        <i></i>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">筛选项类型:</label>
                <div class="col-sm-4">
                    <select class="form-control" ng-model="ctrl.vm.type">
                        <option value="">类型</option>
                        <option value="label">标签</option>
                        <option value="image">图片</option>
                        <option value="color">颜色</option>
                    </select>
                    <i></i>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-4" style="padding-left: 17.5%">
                    <button class="btn btn-sm btn-success" ng-click="ctrl.vm.addChange()">保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wrapper-md " >
    <div class="panel panel-default">
        <div class="panel-heading">
            属性值
        </div>
<div class="table-responsive">
    <table class="table table-striped  b-t b-light">
        <thead>
        <tr>
            <th>id</th>
            <th width="15%">名字</th>
            <th style="padding-left: 10%">icon</th>
            <th>排序</th>
            <th width="15%">后台可见</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr >
            <td></td>
            <td>
                <input class="form-control" type="text" ng-model="ctrl.vm.adDa.name"></td>
            <td>
                <div class="col-sm-6" style="padding-left: 20%">
                    <img class="content-add-image" style="width: 60%" ng-src="{{ctrl.vm.adDa.icon|imgwhq}}" err-src="300:300:90" alt="">
                </div>
                <div class="col-sm-2" style="padding-top: 6%">
                    <input type="file" name="certificate" nv-file-select="" uploader="uploader"
                           ng-click="clearItems()" style="position: absolute;width :30%;padding :0 40px ;height:50px;opacity: 0;"/>
                    <button class="btn btn-sm btn-success">上传</button>
                </div>
                <!--<input type="file" name="certificate" nv-file-select="" uploader="uploader"-->
                <!--ng-click="clearItems()" style="position: absolute;height:50px;opacity: 0;"/>-->
                <!--<button class="btn btn-default">选择icon</button>-->
            </td>
            <td>
                <input class="form-control" type="text" ng-model="ctrl.vm.adDa.sort">
            </td>
            <td>
                <label class="i-switch m-t-xs m-r">
                    <input type="checkbox" ng-model="ctrl.vm.adDa.check">
                    <i></i>
                </label>
            </td>

            <td><button class="btn btn-sm btn-info" ng-click="ctrl.vm.addAttrS()">添加</button></td>
        </tr>
        </tbody>
    </table>
</div>
    </div>
</div>
<div class="wrapper-md " >
    <div class="panel panel-default">
        <div class="panel-heading">
            属性值
        </div>
        <div class="table-responsive">
            <table class="table table-striped  b-t b-light">
                <thead>
                <tr>
                    <th>id</th>
                    <th width="15%">名字</th>
                    <th style="padding-left: 10%">icon</th>
                    <th>排序</th>
                    <th width="15%">后台可见</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="data in ctrl.vm.data">
                    <td>{{data.id}}</td>
                    <td><input type="text" ng-model="data.name" class="form-control"  ng-change="ctrl.vm.change($index)"></td>
                    <td>
                        <div class="col-sm-6" style="padding-left: 20%">
                            <img class="content-add-image" style="width: 60%" ng-src="{{data.icon|imgwhq}}" err-src="300:300:90" alt="">
                        </div>

                        <div class="col-sm-2" style="padding-top: 6%">
                            <input type="file" name="certificate" nv-file-select="" uploader="uploader"
                                   ng-click="clearItems($index)" style="position: absolute;width :30%;padding :0 40px ;height:50px;opacity: 0;"/>
                            <button class="btn btn-sm btn-info">修改</button>
                        </div>

                    </td>
                    <td>
                        <input type="text" ng-model="data.sort" class="form-control"  ng-change="ctrl.vm.change($index)">
                    </td>
                    <td>
                        <select  class="form-control" ng-model="data.backend_show" ng-change="ctrl.vm.change($index)">
                            <option value="1">可见</option>
                            <option value="0">不可见</option>
                        </select>
                    </td>
                    <td>
                        <button class="btn btn-sm btn-success"
                                ng-disabled="ctrl.vm.flag300[$index]==undefined"
                                ng-click="ctrl.vm.upData(data,$index)">
                            保存
                        </button>
                    </td>
                </tr>
                <tr  ng-if="!ctrl.vm.data.length" class="text-center">
                    <td colspan="6">暂无数据！</td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
